<?php
	header('content-type:text/html;charset="utf-8"');
	error_reporting(0);
    require_once 'conn.php';
	require_once "je.php";
	$conn=new mysqli($hn,$un,$pw,$db);
	if($conn->connect_error) die($conn->connect-error);
	
	//$uid=$_REQUEST['uid'];
	
	$json=file_get_contents("php://input");
	$data = json_decode($json,true);
	$uid=$data['article_id'];
	
	if(isset($uid)){
		$query="delete from article where `article_id`='{$uid}'";
		$conn->query('set names utf8');
		$result=$conn->query($query);
		if(!$result) die($conn->error);
		if($conn->affected_rows<1){
			$json_arr = array("code"=>0,"info"=>"删除失败");
		}
		else{
			$json_arr = array("code"=>1,"info"=>"删除成功");
		}
		$json_obj = my_json_encode($json_arr);
		echo $json_obj;
	    $result->close();
		$conn->close();	
	}
	else{
		$json_arr = array("code"=>2,"info"=>"数据有误");
    	$json_obj = my_json_encode($json_arr);
		echo $json_obj;
	}
    


?>